Questo sito utilizza cookies solo per scopi di autenticazione sul sito e nient'altro. Nessuna informazione personale viene tracciata. Leggi l'informativa sui cookies.
Username: Password: oppure
C# / VB.NET - [vb.net]Non si avviano le applicazioni
Forum - C# / VB.NET - [vb.net]Non si avviano le applicazioni

Pagine: [ 1 2 ] Precedente | Prossimo
Avatar
swet (Normal User)
Pro


Messaggi: 128
Iscritto: 01/01/2009

Segnala al moderatore
Postato alle 15:10
Sabato, 31/10/2009
Salve a tutti è un po di tempo che quando pubblico le applicazioni usando l' apposita funzione di vb.net ricevo questo errore all' avvio dell' applicazionehttp://img202.imageshack.us/img202/7849/erroreo.jpg
Lo stesso errore compare quando tento invece di far partire un programma (scritto da me in vb.net) all' avvio di windows attraverso il registro di sistema.




Praticamente installo l' applicazione e invece di avviarsi mi mostra questo errore.

Potete aiutarmi?
Grazie
EDIT: nel caso potesse servire: http://img215.imageshack.us/img215/4870/immaginetg.jpg

Ultima modifica effettuata da swet il 31/10/2009 alle 15:37
PM Quote
Avatar
Il Totem (Admin)
Guru^2


Messaggi: 3635
Iscritto: 24/01/2006

Segnala al moderatore
Postato alle 13:35
Domenica, 01/11/2009
Senza codice non posso dirti molto. System.InvalidOperationException è un tipo di eccezione molto vago e generato per molti motivi diversi (tutti che non hanno a che fare l'uno con l'altro).

PM Quote
Avatar
swet (Normal User)
Pro


Messaggi: 128
Iscritto: 01/01/2009

Segnala al moderatore
Postato alle 15:34
Domenica, 01/11/2009
Ciao Totem, il codice credo sia l' unica cosa che funziona, perché i problemi sono cominciati quando nel mio form ho inserito una LineShape, e quando provavo ad installare il programma sui vari computer mi diceva che dovevo installare Visual Basic Power Pack. Installato anche questo componente e riprovando l' installazione il programma mostrava il seguente errore. Ho deciso quindi di mettere tra i prerequisiti anche l' installazione del Visual Basic Power Pack. Non funzionava nemmeno così, allora ho pensato di rimuovere la LineShape dal form ma sempre lo stesso errore. Non capisco perché!

PM Quote
Avatar
Il Totem (Admin)
Guru^2


Messaggi: 3635
Iscritto: 24/01/2006

Segnala al moderatore
Postato alle 18:02
Lunedì, 02/11/2009
Forse è il codice del designer che provoca l'errore. Hai controllato?

PM Quote
Avatar
swet (Normal User)
Pro


Messaggi: 128
Iscritto: 01/01/2009

Segnala al moderatore
Postato alle 18:39
Lunedì, 02/11/2009
Ciao, secondo me sembra pulito, se vuoi dargli un' occhiata.
Codice sorgente - presumibilmente VB.NET

  1. <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
  2. Partial Class Form1
  3.     Inherits System.Windows.Forms.Form
  4.  
  5.     'Form esegue l'override del metodo Dispose per pulire l'elenco dei componenti.
  6.     <System.Diagnostics.DebuggerNonUserCode()> _
  7.     Protected Overrides Sub Dispose(ByVal disposing As Boolean)
  8.         Try
  9.             If disposing AndAlso components IsNot Nothing Then
  10.                 components.Dispose()
  11.             End If
  12.         Finally
  13.             MyBase.Dispose(disposing)
  14.         End Try
  15.     End Sub
  16.  
  17.     'Richiesto da Progettazione Windows Form
  18.     Private components As System.ComponentModel.IContainer
  19.  
  20.     'NOTA: la procedura che segue è richiesta da Progettazione Windows Form
  21.     'Può essere modificata in Progettazione Windows Form.  
  22.     'Non modificarla nell'editor del codice.
  23.     <System.Diagnostics.DebuggerStepThrough()> _
  24.     Private Sub InitializeComponent()
  25.         Me.components = New System.ComponentModel.Container
  26.         Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
  27.         Me.cmdOK = New System.Windows.Forms.Button
  28.         Me.tmrAccesso = New System.Windows.Forms.Timer(Me.components)
  29.         Me.Button1 = New System.Windows.Forms.Button
  30.         Me.FolderBrowserDialog1 = New System.Windows.Forms.FolderBrowserDialog
  31.         Me.pathw = New System.Windows.Forms.Label
  32.         Me.passw = New System.Windows.Forms.TextBox
  33.         Me.Label3 = New System.Windows.Forms.Label
  34.         Me.Pathok = New System.Windows.Forms.PictureBox
  35.         Me.Psswdok = New System.Windows.Forms.PictureBox
  36.         Me.Label1 = New System.Windows.Forms.Label
  37.         Me.Label2 = New System.Windows.Forms.Label
  38.         CType(Me.Pathok, System.ComponentModel.ISupportInitialize).BeginInit()
  39.         CType(Me.Psswdok, System.ComponentModel.ISupportInitialize).BeginInit()
  40.         Me.SuspendLayout()
  41.         '
  42.         'cmdOK
  43.         '
  44.         Me.cmdOK.Location = New System.Drawing.Point(140, 159)
  45.         Me.cmdOK.Name = "cmdOK"
  46.         Me.cmdOK.Size = New System.Drawing.Size(75, 23)
  47.         Me.cmdOK.TabIndex = 0
  48.         Me.cmdOK.Text = "Fatto"
  49.         Me.cmdOK.UseVisualStyleBackColor = True
  50.         '
  51.         'tmrAccesso
  52.         '
  53.         '
  54.         'Button1
  55.         '
  56.         Me.Button1.Location = New System.Drawing.Point(120, 23)
  57.         Me.Button1.Name = "Button1"
  58.         Me.Button1.Size = New System.Drawing.Size(55, 36)
  59.         Me.Button1.TabIndex = 1
  60.         Me.Button1.Text = "Sfoglia Percorso"
  61.         Me.Button1.UseVisualStyleBackColor = True
  62.         '
  63.         'pathw
  64.         '
  65.         Me.pathw.AutoSize = True
  66.         Me.pathw.Location = New System.Drawing.Point(13, 32)
  67.         Me.pathw.Name = "pathw"
  68.         Me.pathw.Size = New System.Drawing.Size(101, 13)
  69.         Me.pathw.TabIndex = 3
  70.         Me.pathw.Text = "Seleziona la cartella"
  71.         '
  72.         'passw
  73.         '
  74.         Me.passw.Location = New System.Drawing.Point(7, 133)
  75.         Me.passw.Name = "passw"
  76.         Me.passw.PasswordChar = Global.Microsoft.VisualBasic.ChrW(176)
  77.         Me.passw.Size = New System.Drawing.Size(167, 20)
  78.         Me.passw.TabIndex = 6
  79.         '
  80.         'Label3
  81.         '
  82.         Me.Label3.AutoSize = True
  83.         Me.Label3.Location = New System.Drawing.Point(13, 112)
  84.         Me.Label3.Name = "Label3"
  85.         Me.Label3.Size = New System.Drawing.Size(202, 13)
  86.         Me.Label3.TabIndex = 7
  87.         Me.Label3.Text = "Inserisci la password per aprire la cartella:"
  88.         '
  89.         'Pathok
  90.         '
  91.         Me.Pathok.Image = CType(resources.GetObject("Pathok.Image"), System.Drawing.Image)
  92.         Me.Pathok.Location = New System.Drawing.Point(185, 32)
  93.         Me.Pathok.Name = "Pathok"
  94.         Me.Pathok.Size = New System.Drawing.Size(25, 27)
  95.         Me.Pathok.TabIndex = 9
  96.         Me.Pathok.TabStop = False
  97.         '
  98.         'Psswdok
  99.         '
  100.         Me.Psswdok.Image = CType(resources.GetObject("Psswdok.Image"), System.Drawing.Image)
  101.         Me.Psswdok.Location = New System.Drawing.Point(185, 133)
  102.         Me.Psswdok.Name = "Psswdok"
  103.         Me.Psswdok.Size = New System.Drawing.Size(25, 22)
  104.         Me.Psswdok.TabIndex = 10
  105.         Me.Psswdok.TabStop = False
  106.         '
  107.         'Label1
  108.         '
  109.         Me.Label1.AutoSize = True
  110.         Me.Label1.Location = New System.Drawing.Point(4, 9)
  111.         Me.Label1.Name = "Label1"
  112.         Me.Label1.Size = New System.Drawing.Size(41, 13)
  113.         Me.Label1.TabIndex = 11
  114.         Me.Label1.Text = "Step 1:"
  115.         '
  116.         'Label2
  117.         '
  118.         Me.Label2.AutoSize = True
  119.         Me.Label2.Location = New System.Drawing.Point(4, 88)
  120.         Me.Label2.Name = "Label2"
  121.         Me.Label2.Size = New System.Drawing.Size(44, 13)
  122.         Me.Label2.TabIndex = 12
  123.         Me.Label2.Text = "Step 2 :"
  124.         '
  125.         'Form1
  126.         '
  127.         Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
  128.         Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
  129.         Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(128, Byte), Integer), CType(CType(128, Byte), Integer), CType(CType(255, Byte), Integer))
  130.         Me.ClientSize = New System.Drawing.Size(217, 185)
  131.         Me.Controls.Add(Me.Label2)
  132.         Me.Controls.Add(Me.Label1)
  133.         Me.Controls.Add(Me.Psswdok)
  134.         Me.Controls.Add(Me.Pathok)
  135.         Me.Controls.Add(Me.Label3)
  136.         Me.Controls.Add(Me.passw)
  137.         Me.Controls.Add(Me.pathw)
  138.         Me.Controls.Add(Me.Button1)
  139.         Me.Controls.Add(Me.cmdOK)
  140.         Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
  141.         Me.Name = "Form1"
  142.         Me.ShowIcon = False
  143.         Me.ShowInTaskbar = False
  144.         Me.Text = "FolderPassword"
  145.         CType(Me.Pathok, System.ComponentModel.ISupportInitialize).EndInit()
  146.         CType(Me.Psswdok, System.ComponentModel.ISupportInitialize).EndInit()
  147.         Me.ResumeLayout(False)
  148.         Me.PerformLayout()
  149.  
  150.     End Sub
  151.     Friend WithEvents cmdOK As System.Windows.Forms.Button
  152.     Friend WithEvents tmrAccesso As System.Windows.Forms.Timer
  153.     Friend WithEvents Button1 As System.Windows.Forms.Button
  154.     Friend WithEvents FolderBrowserDialog1 As System.Windows.Forms.FolderBrowserDialog
  155.     Friend WithEvents pathw As System.Windows.Forms.Label
  156.     Friend WithEvents passw As System.Windows.Forms.TextBox
  157.     Friend WithEvents Label3 As System.Windows.Forms.Label
  158.     Friend WithEvents Pathok As System.Windows.Forms.PictureBox
  159.     Friend WithEvents Psswdok As System.Windows.Forms.PictureBox
  160.     Friend WithEvents Label1 As System.Windows.Forms.Label
  161.     Friend WithEvents Label2 As System.Windows.Forms.Label
  162.  
  163. End Class




PM Quote
Avatar
pinza (Normal User)
Rookie


Messaggi: 48
Iscritto: 21/09/2009

Segnala al moderatore
Postato alle 18:56
Lunedì, 02/11/2009
System.InvalidOperationException ,
mi ha fatto perdere un programma

prova a togliere questi tipi di codici
Codice sorgente - presumibilmente C# / VB.NET

  1. dim a as string =

dim a as string =

avvolte se aggiungi nuovi componenti danno noia

e anche aggiungiendo file a resources si puo avere problemi

spero di esserti stato utile

Ultima modifica effettuata da pinza il 02/11/2009 alle 18:57
PM Quote
Avatar
swet (Normal User)
Pro


Messaggi: 128
Iscritto: 01/01/2009

Segnala al moderatore
Postato alle 19:12
Lunedì, 02/11/2009
in che senso "anche aggiungiendo file a resources si puo avere problemi" ? La prima soluzione da te postata non ha funzionato purtroppo!

PM Quote
Avatar
pinza (Normal User)
Rookie


Messaggi: 48
Iscritto: 21/09/2009

Segnala al moderatore
Postato alle 19:42
Lunedì, 02/11/2009
Nel senso che se aggiungi immagini o altri elementi al progetto si possono generare errori
ma a ragione totem, ci sono tanti motivi per quella eccezione io ti dico quelli che anno risolto il mio problema

PM Quote
Avatar
Il Totem (Admin)
Guru^2


Messaggi: 3635
Iscritto: 24/01/2006

Segnala al moderatore
Postato alle 18:00
Martedì, 03/11/2009
Potrebbe anche trattarsi di un'eccezione qualsiasi che, posta nel costruttore o in Form_Load, fa fallire il procedimento e viene generata la InvalidOperationException (spesso, infatti, nei dettagli dell'eccezione c'è la descrizione di un'altra eccezione). Meglio vedere il codice a questo punto.

PM Quote
Pagine: [ 1 2 ] Precedente | Prossimo